﻿using SecsEquip;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EquipSecs300.Parameter
{
    [Serializable]
    public class CarrierInfo
    {
        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public string pCarrierID { get; set; }

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public string pLocationID { get; set; }

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public string pUsage { get; set; }

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public string pTagData { get; set; }

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public int nCapacity { get; set; }

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public CarrierIDStatus nCarrierIDStatus { get; set; } = CarrierIDStatus.NOT_READ;

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public CarrierAccessingStatus nCarrierAccessingStatus { get; set; } = CarrierAccessingStatus.NOT_ACCESSED;

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public CarrierSlotMapStatus nSlotMapStatus { get; set; } = CarrierSlotMapStatus.NOT_READ;

        [Category("卡匣信息"), DisplayName(""), Description(""), ReadOnly(true)]
        public int nSubstrateCount { get; set; }

        [Category("卡匣信息"), DisplayName(""), Description("")]
        //[TypeConverter(typeof(EquipSecs300.ParamHMI.PropertiesExpandConverter))]
        public CarrierSlotDataInfo[] pSlotData { get; set; } = new CarrierSlotDataInfo[25];


        public CarrierInfo()
        {
            nCapacity = 0;
            nCarrierIDStatus = CarrierIDStatus.NOT_READ;
            nCarrierAccessingStatus = CarrierAccessingStatus.NOT_ACCESSED;
            nSlotMapStatus = CarrierSlotMapStatus.NOT_READ;
            nSubstrateCount = 0;
            if (pSlotData != null)
            {
                for (int i = 0; i < 25; i++)
                {
                    pSlotData[i] = new CarrierSlotDataInfo();
                    pSlotData[i].nSlot = i + 1;
                }
            }
        }
    }
}
